#include <stdio.h>
#include <math.h>
#include <string.h>
int titleToNumber(char* columnTitle)
{
    int num = strlen(columnTitle);
    int result = 0;
    for (int i = 0; i < num; i++)
    {
        int ret = (int)columnTitle[i] - 64;
        result += (int)pow(26, num - i - 1) * ret;
    }
    return result;
}

int main()
{
    char arr[] = "AB";
    printf("%d\n", titleToNumber(arr));
	return 0;
}